package com.wangshen.administrator.ygqq.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.RadioGroup;
import android.widget.TableLayout;
import android.widget.TextView;

import com.gc.flashview.FlashView;
import com.wangshen.administrator.ygqq.R;
import com.wangshen.administrator.ygqq.view.ScrollBanner;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by Administrator on 2016/7/25.
 */
public class HomeFragment extends Fragment {
    @InjectView(R.id.fv)
    FlashView fv;
    @InjectView(R.id.home_viewpager)
    ViewPager homeViewpager;
    @InjectView(R.id.home_table)
    RadioGroup homeTable;
    @InjectView(R.id.home_grid)
    GridView homeGrid;
    private TextView tv;
    private Context mContext;
    private List<Object>list;
    private List<String> imageUrl;
    private List<String> datas;
    private ScrollBanner scrollBanner;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_home, container, false);
        ButterKnife.inject(this, view);
        mContext=getActivity();
        return view;


    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        scrollBanner= (ScrollBanner) view.findViewById(R.id.scrollbanner);
        datas=new ArrayList<>();
        for (int i=0;i<20;i++){
            datas.add("虽然你技术好,但是你丑啊"+i+"次");
        }
        scrollBanner.setList(datas);
        scrollBanner.startScroll();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.reset(this);
    }
}
